#ifndef MTEXT_H
#define MTEXT_H

#include <QGraphicsTextItem>
#include <QPen>
QT_BEGIN_NAMESPACE
class QFocusEvent;
class QGraphicsItem;
class QGraphicsScene;
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE

class mProcess;

class mText : public QGraphicsTextItem
{
    Q_OBJECT

public:
    mText(mProcess *bindingItem,QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    //~mText();

    enum { Type = UserType + 3 };

    int type() const
    { return Type; }

    void  updatePosition();

    mProcess *BindingItem;

    mProcess *BindTextItem() const{ return BindingItem; }

signals:
    void lostFocus(mText *item);
    void selectedChange(QGraphicsItem *item);

protected:
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    void focusOutEvent(QFocusEvent *event);
    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);

};

#endif // MTEXT_H
